<template>
	<u-popup :show="show" round="50rpx">
		<view class="container">
			<view class="container__header">
				<view class="iconfont icon-close" @click="close"></view>
			</view>
			<view class="container__tips" v-if="tipType == 'Recharge'">
				{{$t('order.Buy-tips1')}}
			</view>
			<view class="container__exchange-tips" v-else-if="tipType == 'Exchange'">
				{{$t('order.Buy-tips2')}}
				<text class="deep-text"> {{exchangeWorth}} </text>
				<text class="orange-text">{{exchangeCurrency}}</text>
				{{$t('order.Buy-using')}}
				<text class="deep-text"> {{exchangeRate}}</text>
				<text class="orange-text">{{$t('order.Exchange-rate')}}?</text>
			</view>
			<view class="container__money">
				{{payMoney}}
			</view>
			<view class="container__bottom" @click="confirmHandle">
				{{$t('index.Confirm')}}
			</view>
		</view>
	</u-popup>
</template>
<script>
	export default {
		name: 'ConfirmPopup',
		data() {
			return {

			}
		},
		props: {
			show: {
				type: Boolean,
				default: () => false
			},
			tipType: {
				type: String,
				default: 'Recharge'
			},
			exchangeWorth: {
				type: [String, Number],
				default: 100
			},
			exchangeCurrency: {
				type: String,
				default: 'RUB'
			},
			exchangeRate: {
				type: [String, Number],
				default: '1.000'
			},
			payMoney: {
				default: '₽100'
			},
			objValue: {
				type: Object,
				default: () => {}
			},
		},
		methods: {
			close() {
				this.$emit('update:show', false)
			},
			confirmHandle() {
				this.$emit('confirm',this.objValue)
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		position: relative;
		height: 450rpx;
		padding: 0 30rpx 10rpx;
		font-size: 28rpx;
		font-family: HarmonyOS Sans-Regular, HarmonyOS Sans;

		&__header {
			height: 108rpx;
			line-height: 108rpx;
			text-align: right;

			.icon-close {
				font-weight: 500;
				color: #606165;
				font-size: 48rpx;
			}
		}

		&__tips {
			width: 690rpx;
			font-family: HarmonyOS Sans-Regular, HarmonyOS Sans;
			color: #FE6600;
			text-align: center;
			line-height: 40rpx;
		}

		&__exchange-tips {
			width: 690rpx;
			font-family: HarmonyOS Sans-Regular, HarmonyOS Sans;
			color: #878787;
			text-align: center;
			line-height: 40rpx;

			.deep-text {
				display: inline-block;
				color: #FE6600;
				font-weight: 600;
				margin: 0 10rpx;
			}

			.orange-text {
				display: inline-block;
				color: #FE6600;
				margin-right: 10rpx;
			}
		}

		&__money {
			font-size: 48rpx;
			font-family: HarmonyOS Sans-Medium, HarmonyOS Sans;
			font-weight: 500;
			color: #000000;
			text-align: center;
			margin-top: 30rpx;
		}

		&__bottom {
			width: 690rpx;
			height: 80rpx;
			background: #61BDB2;
			border-radius: 80rpx;
			position: absolute;
			bottom: 10rpx;
			left: 50%;
			transform: translateX(-50%);
			display: flex;
			justify-content: center;
			align-items: center;
			font-weight: 500;
			color: #FFFFFF;
		}
	}
</style>
